package File;

import java.io.*;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Ap0stoL2
 * Date: 2023-08-06
 * Time: 21:47
 */

//PrintWriter
public class test1 {
    public static void main(String[] args) throws IOException {

        try(OutputStream os = new FileOutputStream("d:/test.txt")){

            // 告诉它，我们的字符集编码是 utf-8 的
            //OutputStreamWriter osWriter = new OutputStreamWriter(os,"utf-8");

            //PrintWriter writer = new PrintWriter(osWriter);
            PrintWriter writer = new PrintWriter(os);


            // 接下来我们就可以方便的使用 writer 提供的各种方法了
            writer.print("Hello");
            writer.println("你好");
            writer.printf("%d: %s\n", 1, "没什么");
            // 不要忘记 flush
            writer.flush();


        }
    }
}
